import 'package:flutter/material.dart';
import 'package:flutter_chapter_04/src/pages/DemoPages.dart';
import 'package:flutter_chapter_04/src/pages/FirstPage.dart';
import 'package:flutter_chapter_04/src/pages/HeartProvide.dart';
import 'package:provide/provide.dart';

import '../data_share/transfer_data_entity.dart';
import '../data_share/transfer_stream_singleton.dart';

void main() {
  runApp(const MyApp());
}

var data = ProvideData();

class MyApp extends StatelessWidget {
  const MyApp({Key key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    var transferData = TransferDataEntity();
    streamSingletonData.setTransferData(transferData);

    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: ShareDataWidget(
        data:data,
        child: const FirstPage(),
      ),
    );
  }
}

